//
//  NSDate+SCString.m
//  Shuaiche
//
//  Created by 党帅 on 2019/5/14.
//  Copyright © 2019 zzs. All rights reserved.
//

#import "NSDate+SCString.h"

@implementation NSDate (SCString)
+ (NSString *)scDateStringWithFormat:(NSString *)format {
    if (!format) {
        format = @"yyyy-MM-dd";
    }
    NSDate *date = [NSDate date];
    NSDateFormatter *formater = [[NSDateFormatter alloc] init];
    formater.dateFormat = format;
    return [formater stringFromDate:date];
}

- (NSString *)stringFromFormat:(NSString *)format {
    if (!format) {
        format = @"yyyy-MM-dd";
    }
    NSDateFormatter *formater = [[NSDateFormatter alloc] init];
    formater.dateFormat = format;
    return [formater stringFromDate:self];
}

@end
